import { ReqDepartmentListResponse } from '@/api/hospitalList/hospitalList';
import type { departmentList } from '@/api/hospitalList/model//hospitalListTypes';
import { Card, Col, Pagination, Row, Tag } from 'antd'
import Table, { ColumnsType } from 'antd/lib/table';
import Tree, { DataNode } from 'antd/lib/tree';
import React, { useEffect, useState } from 'react'
import { useParams } from 'react-router-dom';

export default function HospitalSchedule() {


    //获取地址栏 params 参数
    let {hoscode} = useParams();


    //声明科室状态
    let [department,setDepartment] = useState<departmentList>([]);

    //声明所有的一级科室 depcode 
    let [expandedKey,setExpandedKey] = useState<string[]>([]);

    //获取 左侧高度 
    let height = document.documentElement.clientHeight - 64 - 34 - 24*2 - 22 - 70;


    //表格 表头信息
    let columns:ColumnsType<any> = [
        {
            title:"序号",
            align:"center",
            render(text,row,index){
                return index+1;
            }
        },
        {
            title:"职称",
            dataIndex:"xxx",
        },
        {
            title:"号源时间",
            dataIndex:"xxx",
        },
        {
            title:"总预约数",
            dataIndex:"xxx",
        },
        {
            title:"剩余预约数",
            dataIndex:"xxx",
        },
        {
            title:"挂号费(元)",
            dataIndex:"xxx",
        },
        {
            title:"擅长技能",
            dataIndex:"xxx",
        }
    ]


    return (
        <Card>
            {/* 面包屑 */}
            <p>选择： 北京人民医院 / xxxxx  /  xxxx</p>

            {/* 内容部分 */}
            <Row gutter={30}>
                {/* 左侧部分 */}
                <Col span={5}>
                    <div style={{ border: "1px solid #f0f0f0" ,height:height,overflow:"auto"}}>
                        <Tree
                            expandedKeys={expandedKey}
                            treeData={department as []}
                            // treeData={treeData}
                            fieldNames={{
                                title:"depname",
                                key:"depcode"
                            }}
                        />
                    </div>
                </Col>
            </Row>

        </Card>
    )
}
